package com.mydemo.design_pattern.structure_type.proxy_pattern.jdk;

import java.lang.reflect.Proxy;

/**
 * <p></p >
 *
 * @author liming1
 * @version $Id: DemoTest, v1.0 2019-09-19 11:36 liming1 Exp $
 */
public class DemoTest {
    public static void main(String[] args) {
        MyProxy myProxy = new MyProxy(new RealSubject());
        Subject o =(Subject)Proxy.newProxyInstance(DemoTest.class.getClassLoader(), new Class[]{Subject.class}, myProxy);
        o.name();
    }
}
